﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TpBaseObjects.Base;
using TpExtensions;

namespace TpBaseObjects.Objects {

    public class Organisation : MyBaseModel {

        #region Members
        #endregion

        #region Constructor

        public Organisation() {
        }

        #endregion

        #region Properties

        private int orgKey;
        public int OrgKey {
            get { return this.orgKey; }
            set { this.orgKey = value; }
        }

        private string orgTS;
        public string OrgTS {
            get { return this.orgTS; }
            set { this.orgTS = value; }
        }

        private DateTime änderung;
        public DateTime Änderung {
            get { return this.änderung; }
            set { this.änderung = value; }
        }

        private string prefix;
        public string Prefix {
            get { return this.prefix; }
            set {
                if (this.prefix == value) {
                    return;
                }
                this.prefix = value;
                OnPropertyChanged(() => Prefix);
            }
        }

        private string name;
        public string OrgName {
            get { return this.name; }
            set {
                if (this.name == value) {
                    return;
                }
                this.name = value;
                OnPropertyChanged(() => OrgName);
            }
        }

        public string OrgFullName {
            get { return this.Prefix.AddSpace() + this.OrgName.AddSpace() + this.RechtsForm.AddSpace() + this.ZusätzeFW; }
        }

        private string zusätzeFW;
        public string ZusätzeFW {
            get { return this.zusätzeFW; }
            set {
                if (this.zusätzeFW == value) {
                    return;
                }
                this.zusätzeFW = value;
                OnPropertyChanged(() => ZusätzeFW);
            }
        }

        private string rechtsForm;
        public string RechtsForm {
            get { return this.rechtsForm; }
            set {
                if (this.rechtsForm == value) {
                    return;
                }
                this.rechtsForm = value;
                OnPropertyChanged(() => RechtsForm);
            }
        }

        private int rechtsFormKey;
        public int RechtsFormKey {
            get { return this.rechtsFormKey; }
            set {
                if (this.rechtsFormKey == value) {
                    return;
                }
                this.rechtsFormKey = value;
                OnPropertyChanged(() => RechtsFormKey);
            }
        }

        private string suchbegriff;
        public string Suchbegriff {
            get { return this.suchbegriff; }
            set {
                if (this.suchbegriff == value) {
                    return;
                }
                this.suchbegriff = value;
                OnPropertyChanged(() => Suchbegriff);
            }
        }

        private string abteilung;
        public string Abteilung {
            get { return this.abteilung; }
            set {
                if (this.abteilung == value) {
                    return;
                }
                this.abteilung = value;
                OnPropertyChanged(() => Abteilung);
            }
        }

        private string adresse;
        public string Adresse {
            get { return this.adresse; }
            set {
                if (this.adresse == value) {
                    return;
                }
                this.adresse = value;
                OnPropertyChanged(() => Adresse);
            }
        }

        private int ePLZ;
        public int EPLZ {
            get { return this.ePLZ; }
            set {
                if (this.ePLZ == value) {
                    return;
                }
                this.ePLZ = value;
                OnPropertyChanged(() => EPLZ);
            }
        }

        private string straße;
        public string Straße {
            get { return this.straße; }
            set {
                if (this.straße == value) {
                    return;
                }
                this.straße = value;
                OnPropertyChanged(() => Straße);
            }
        }

        private string telNr1;
        public string TelNr1 {
            get { return this.telNr1; }
            set {
                if (this.telNr1 == value) {
                    return;
                }
                this.telNr1 = value;
                OnPropertyChanged(() => TelNr1);
            }
        }

        private string telNr2;
        public string TelNr2 {
            get { return this.telNr2; }
            set {
                if (this.telNr2 == value) {
                    return;
                }
                this.telNr2 = value;
                OnPropertyChanged(() => TelNr2);
            }
        }

        private string faxNr;
        public string FaxNr {
            get { return this.faxNr; }
            set {
                if (this.faxNr == value) {
                    return;
                }
                this.faxNr = value;
                OnPropertyChanged(() => FaxNr);
            }
        }

        private string eMail;
        public string EMail {
            get { return this.eMail; }
            set {
                if (this.eMail == value) {
                    return;
                }
                this.eMail = value;
                OnPropertyChanged(() => EMail);
            }
        }

        private bool isDirty;
        public bool IsDirty {
            get { return this.isDirty; }
            set {
                if (this.isDirty == value) {
                    return;
                }
                this.isDirty = value;
                OnPropertyChanged(() => IsDirty);
            }
        }

        private string kurzwahlspeicher;
        public string Kurzwahlspeicher {
            get { return this.kurzwahlspeicher; }
            set {
                if (this.kurzwahlspeicher == value) {
                    return;
                }
                this.kurzwahlspeicher = value;
                OnPropertyChanged(() => Kurzwahlspeicher);
            }
        }

        private bool kG;
        public bool KG {
            get { return this.kG; }
            set {
                if (this.kG == value) {
                    return;
                }
                this.kG = value;
                OnPropertyChanged(() => KG);
            }
        }

        private bool mB;
        public bool MB {
            get { return this.mB; }
            set {
                if (this.mB == value) {
                    return;
                }
                this.mB = value;
                OnPropertyChanged(() => MB);
            }
        }

        private int tochterVon;
        public int TochterVon {
            get { return this.tochterVon; }
            set {
                if (this.tochterVon == value) {
                    return;
                }
                this.tochterVon = value;
                OnPropertyChanged(() => TochterVon);
            }
        }

        private int kreditlimit;
        public int Kreditlimit {
            get { return this.kreditlimit; }
            set {
                if (this.kreditlimit == value) {
                    return;
                }
                this.kreditlimit = value;
                OnPropertyChanged(() => Kreditlimit);
            }
        }

        private string notiz;
        public string Notiz {
            get { return this.notiz; }
            set {
                if (this.notiz == value) {
                    return;
                }
                this.notiz = value;
                OnPropertyChanged(() => Notiz);
            }
        }

        private bool export;
        public bool Export {
            get { return this.export; }
            set {
                if (this.export == value) {
                    return;
                }
                this.export = value;
                OnPropertyChanged(() => Export);
            }
        }

        private string plz;
        public string Plz {
            get { return this.plz; }
            set {
                if (this.plz == value) {
                    return;
                }
                this.plz = value;
                OnPropertyChanged(() => Plz);
            }
        }

        private string ort;
        public string Ort {
            get { return this.ort; }
            set {
                if (this.ort == value) {
                    return;
                }
                this.ort = value;
                OnPropertyChanged(() => Ort);
            }
        }

        private string web;
        public string Web {
            get { return this.web; }
            set {
                if (this.web == value) {
                    return;
                }
                this.web = value;
                OnPropertyChanged(() => Web);
            }
        }

        private string uid;
        public string UID {
            get { return this.uid; }
            set {
                if (this.uid == value) {
                    return;
                }
                this.uid = value;
                OnPropertyChanged(() => UID);
            }
        }

        private List<Person> myList = new List<Person>();
        public List<Person> MyPersons {
            get { return this.myList; }
        }

        #endregion

        #region Methods

        public void AddPerson(Person person) {
            this.myList.Add(person);
            OnPropertyChanged(() => MyPersons);
        }

        #endregion

        #region Overides

        public override string ToString() {
            return this.OrgFullName + " (" + this.OrgKey.ToString() + ")";
        }

        #endregion

    }
}
